package cn.wokoba.service.activity.service.quota.policy.impl;



import cn.wokoba.service.activity.model.CreateQuotaOrderAggregate;
import cn.wokoba.service.activity.model.OrderStateVO;
import cn.wokoba.service.activity.repository.ActivityRepository;
import cn.wokoba.service.activity.service.quota.policy.ITradePolicy;
import org.springframework.stereotype.Service;

//积分兑换，支付类订单
@Service("credit_pay_trade")
public class CreditPayTradePolicy implements ITradePolicy {

    private final ActivityRepository activityRepository;

    public CreditPayTradePolicy(ActivityRepository activityRepository) {
        this.activityRepository = activityRepository;
    }

    @Override
    public void trade(CreateQuotaOrderAggregate createQuotaOrderAggregate) {
        createQuotaOrderAggregate.setOrderState(OrderStateVO.wait_pay);
        activityRepository.doSaveCreditPayOrder(createQuotaOrderAggregate);
    }

}
